import React, { Component } from 'react'
import { observer } from 'mobx-react/custom'
import RecordPresentVM from 'cvm/record/recordPresent'
import './recordPresent.less'

const RecordPresentList = observer(({ vm }) => {
  return (
    <div className='record-present'>
      {
        vm.responsePresentList.length > 0 ? vm.responsePresentList.map((item, index) => {
          return (
            <div className='flex-wrap flow-record' key={index}>
              <div className='flex-3'>
                {
                  <div>
                    <p className='date'>{item.CashTypeStr}-{item.CashName}</p>
                    <p className='percent'>{item.CreatedTimeStr}</p>
                  </div>
                }
              </div>
              <div className='flex-1'>
                <p className='price'>￥{item.CashTotal.toFixed(2)}</p>
              </div>
            </div>
          )
        }) : vm.record && <div className='none-record'>
          <img src={require('../../images/none-tixian.png')} />
          <p>暂无提现记录</p>
        </div>
      }
    </div>
  )
})

@observer
class recordPresent extends Component {
  constructor (props) {
    super(props)
    window.document.title = '提现记录'
    this.vm = new RecordPresentVM(props)
  }
  render () {
    return (
      <div>
        <RecordPresentList vm={this.vm} />
      </div>
    )
  }
}

export default recordPresent
